How to Upload File in ASP.NET MVC 3.0?
2287
17-Nov-2014
I want to upload file in asp.net mvc. How can I upload the file using html input file control?
Updated on 18-Nov-2014
Anonymous User
18-Nov-2014You don't use a file input control. Server side controls are not used in ASP.NET MVC.
So you would start by creating an HTML form which would contain a file input:
@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { enctype = "multipart/form-data" })){
<input type="file" name="file" />
<input type="submit" value="OK" />
}
and then you would have a controller to handle the upload: